<?php
/**
 * Index.php
 * 
 * @category    Madoqua
 * @package     Module
 * @subpackage  Install
 */

/** base class */
require_once 'Madoqua/Form.php';

/** md5 filter for pw */
require_once 'Madoqua/Filter/Md5.php';

/**
 * Install_User_Index
 * 
 * @category    Madoqua
 * @package     Module
 * @subpackage  Install
 */
class Install_User_Index extends Madoqua_Form
{
    /**
     * constructor
     *
     * @param array $options
     */
    public function __construct($options) {
        parent::__construct($options);
        
        $this->addElement('text', 'username', array(
            'required' => true,
            'label' => 'Username',
            'validators' => array(
                array('StringLength', false, array(5, 255))
            ),
            'autocomplete' => 'off'
        ));
        //username
        
        $this->addElement('password', 'password', array(
            'required' => true,
            'label' => 'Password',
            'validators' => array(
                array('StringLength', false, array(5, 255))
            ),
            'filters' => array(
                new Madoqua_Filter_Md5()
            ),
            'autocomplete' => 'off'
        ));        
        //password
        
        $this->addElement('text', 'openid', array(
            'required' => false,
            'label' => 'Openid (optional)',
            'validators' => array(
                array('StringLength', false, array(0, 255))
            ),
            'autocomplete' => 'off'
        ));        
        //open id (optional)
        
        $this->addElement('submit', 's', array(
            'label' => 'Submit'
        ));
        //submit
    }
}
